package com.mocai.merchant.spring.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

/**
 * 自定义切面模板
 */
public abstract class AspectTemplate {

    /**
     * 执行前通知
     *
     * @param joinPoint
     */
    protected void beforeAdvice(JoinPoint joinPoint) {
        throw new UnsupportedOperationException();
    }

    /**
     * 执行后通知
     *
     * @param joinPoint
     */
    protected void afterAdvice(JoinPoint joinPoint) {
        throw new UnsupportedOperationException();
    }

    /**
     * 返回通知
     *
     * @param joinPoint
     * @param returnValue
     */
    protected void afterReturningAdvice(JoinPoint joinPoint, Object returnValue) {
        throw new UnsupportedOperationException();
    }

    /**
     * 异常通知
     *
     * @param joinPoint
     * @param ex
     */
    protected void afterThrowingAdvice(JoinPoint joinPoint, Throwable ex) {
        throw new UnsupportedOperationException();
    }

    /**
     * 环绕通知
     *
     * @param pjp
     */
    protected Object aroundAdvice(ProceedingJoinPoint pjp) throws Throwable {
        throw new UnsupportedOperationException();
    }


}
